# A plotting R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages( "ggplot2" ); library( ggplot2 ); # -------------------------------------------------------------------------- # If you don't have the scales package installed, uncomment the following line: # install.packages( "scales" ); library( scales ); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","log10_p_value","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0006337","nucleosome disassembly", 0.001,-6.090, 1.420, 2.146, 0.1107,0.629,0.000), c("GO:0007626","locomotory behavior", 0.020, 0.090,-6.464, 3.364, 0.5086,0.881,0.000), c("GO:0008217","regulation of blood pressure", 0.014, 4.680,-3.756, 3.189, 0.2868,0.905,0.000), c("GO:0055114","oxidation-reduction process",16.676, 4.785,-0.678, 6.279, 1.0401,0.952,0.000), c("GO:0042692","muscle cell differentiation", 0.034, 0.742, 0.757, 3.589, 0.4117,0.816,0.013), c("GO:0051187","cofactor catabolic process", 0.531, 2.477, 5.461, 4.781, 0.4117,0.707,0.019), c("GO:0000278","mitotic cell cycle", 0.103,-5.948,-5.030, 4.068, 0.7128,0.912,0.020), c("GO:0045333","cellular respiration", 4.810, 6.388, 1.307, 5.739, 0.5086,0.796,0.059), c("GO:0006091","generation of precursor metabolites and energy", 6.142,-1.604,-2.963, 5.845, 0.8888,0.894,0.084), c("GO:0010035","response to inorganic substance", 0.247,-0.746,-6.385, 4.449, 0.5086,0.872,0.272), c("GO:0007264","small GTPase mediated signal transduction", 0.496, 1.922,-5.411, 4.753, 0.7639,0.828,0.350), c("GO:0031034","myosin filament assembly", 0.001,-6.670, 1.033, 2.210, 0.1107,0.625,0.421), c("GO:0006323","DNA packaging", 0.318,-5.779, 2.674, 4.559, 0.4117,0.582,0.454), c("GO:0006511","ubiquitin-dependent protein catabolic process", 0.200, 0.517, 6.430, 4.359, 0.5086,0.744,0.457), c("GO:0046164","alcohol catabolic process", 0.929, 1.438, 6.290, 5.025, 0.6548,0.636,0.473), c("GO:0016052","carbohydrate catabolic process", 1.399, 1.782, 6.251, 5.203, 0.6548,0.690,0.525), c("GO:0044275","cellular carbohydrate catabolic process", 0.982, 1.161, 6.528, 5.049, 0.6548,0.614,0.557), c("GO:0031498","chromatin disassembly", 0.001,-6.527, 1.711, 2.155, 0.1107,0.643,0.558), c("GO:0032986","protein-DNA complex disassembly", 0.001,-5.818, 1.995, 2.146, 0.1107,0.660,0.561), c("GO:0007269","neurotransmitter secretion", 0.010, 4.198,-4.153, 3.063, 0.2868,0.872,0.576), c("GO:0007052","mitotic spindle organization", 0.006,-6.377,-0.013, 2.839, 0.2868,0.617,0.593), c("GO:0000302","response to reactive oxygen species", 0.096,-1.156,-6.461, 4.039, 0.2868,0.865,0.602), c("GO:0031033","myosin filament organization", 0.002,-6.570, 0.724, 2.250, 0.1107,0.648,0.617), c("GO:0043933","macromolecular complex subunit organization", 1.085,-6.268, 2.697, 5.092, 0.7639,0.655,0.619), c("GO:0007265","Ras protein signal transduction", 0.221, 1.671,-5.475, 4.402, 0.2868,0.834,0.623), c("GO:0007010","cytoskeleton organization", 0.203,-6.489, 2.034, 4.363, 0.7128,0.583,0.642), c("GO:0006099","tricarboxylic acid cycle", 0.483, 3.215, 4.798, 4.741, 0.4117,0.624,0.682), c("GO:0006084","acetyl-CoA metabolic process", 0.531, 4.734, 3.400, 4.782, 0.4117,0.817,0.685)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");